<h1>Todo Lists</h1>

<%= link_to 'Create New Todo List', :action => 'new' %>
<br />
<br />

<%= link_to 'Previous page', { :page => @todo_list_pages.current.previous } if @todo_list_pages.current.previous %>
<%= link_to 'Next page', { :page => @todo_list_pages.current.next } if @todo_list_pages.current.next %> 

<br />

<table border = 1>
  <tr>
    <th> List Name </th>
    <th> Updated at </th>
    <th></th>
    <th></th>
  </tr>
  
<% for todo_list in @todo_lists %>
  <tr>
    <td><%= link_to todo_list.name, :action => 'show', :id => todo_list %></td>
    <td><%=h todo_list.updated_at %></td>
    <td><%= link_to 'Edit', :action => 'edit', :id => todo_list %></td>
    <td><%= link_to 'Destroy', { :action => 'destroy', :id => todo_list }, :confirm => 'Are you sure?', :method => :post %></td>
  </tr>
<% end %>
</table>

<br />

